package org.or5e.service.core.ds.wm;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.or5e.service.core.dao.WishMaster;
import org.or5e.service.core.ds.BasicDataSource;
import org.or5e.service.core.ds.DataSourceFactory;
import org.or5e.service.core.sm.SessionManager;

public class WishMasterDataSourceImpl extends BasicDataSource implements WishMasterDataSource {

	public WishMasterDataSourceImpl(SessionFactory sessionFactory, SessionManager sessionManager) {
		super(sessionFactory, sessionManager);
	}

	@Override
	public List<WishMaster> getWishMasterList(String eventID) {
		Session session = sessionFactory.openSession();
		@SuppressWarnings("unchecked")
		List<WishMaster> wMaster = session.createQuery("from WishMaster").list();
		System.out.println("Wish Master Size :"+wMaster);
		return null;
	}

	@Override
	public String getName() {
		return "WishMasterDataSourceImpl";
	}
	public static void main(String[] args) {
		WishMasterDataSource dSource = (WishMasterDataSource)DataSourceFactory.getDataSourceFactory().getDataSource(WishMasterDataSource.class);
		dSource.getWishMasterList("1001");
	}
}